From 96965400e144cee20f335bb7046775ce40b736d1 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 17 Oct 2025 14:48:11 -0700 Subject: [PATCH] digitemp: fix compilation with gcc15 Upstream backports. Move away from codeload. Local tar archives are smaller. Add missing PKG_LICENSE_FILES. Signed-off-by: Rosen Penev --- utils/digitemp/Makefile | 10 +++++--- utils/digitemp/patches/010-prototype.patch | 30 ++++++++++++++++++++++ utils/digitemp/patches/020-time.patch | 21 +++++++++++++++ 3 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 utils/digitemp/patches/010-prototype.patch create mode 100644 utils/digitemp/patches/020-time.patch diff --git a/utils/digitemp/Makefile b/utils/digitemp/Makefile index c5e5f179d6..a98f755b69 100644 --- a/utils/digitemp/Makefile +++ b/utils/digitemp/Makefile @@ -11,14 +11,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=digitemp PKG_VERSION:=3.7.2 -PKG_RELEASE:=2 +PKG_RELEASE:=3 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/bcl/digitemp/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=683df4ab5cc53a45fe4f860c698f148d34bcca91b3e0568a342f32d64d12ba24 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/bcl/digitemp +PKG_SOURCE_VERSION:=v$(PKG_VERSION) +PKG_MIRROR_HASH:=4b2a3f074c98a56e1816d760ecf5f26fb2293b26a8bda362d86627c3ddc8b318 PKG_MAINTAINER:=Jasper Scholte PKG_LICENSE:=GPL-2.0-or-later +PKG_LICENSE_FILES:=COPYING include $(INCLUDE_DIR)/package.mk diff --git a/utils/digitemp/patches/010-prototype.patch b/utils/digitemp/patches/010-prototype.patch new file mode 100644 index 0000000000..9ff3bd61b8 --- /dev/null +++ b/utils/digitemp/patches/010-prototype.patch @@ -0,0 +1,30 @@ +From fa56b0f78d12f97ac44e0a367d413a9e88611d1c Mon Sep 17 00:00:00 2001 +From: Robert Scheck +Date: Thu, 16 Jan 2025 21:24:41 +0100 +Subject: [PATCH] Fix conflicting prototype +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +src/digitemp.c:171:6: error: conflicting types for ‘free_coupler’; have ‘void(int)’ + 171 | void free_coupler( int free_only ) + | ^~~~~~~~~~~~ +In file included from src/digitemp.c:78: +src/digitemp.h:90:6: note: previous declaration of ‘free_coupler’ with type ‘void(void)’ + 90 | void free_coupler(); + | ^~~~~~~~~~~~ +--- + src/digitemp.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/digitemp.h ++++ b/src/digitemp.h +@@ -87,7 +87,7 @@ struct _coupler { + + /* Prototypes */ + void usage(); +-void free_coupler(); ++void free_coupler( int free_only ); + float c2f( float temp ); + int build_tf( char *time_format, char *format, int sensor, + float temp_c, int humidity, unsigned char *sn ); diff --git a/utils/digitemp/patches/020-time.patch b/utils/digitemp/patches/020-time.patch new file mode 100644 index 0000000000..b9630ff8f5 --- /dev/null +++ b/utils/digitemp/patches/020-time.patch @@ -0,0 +1,21 @@ +From 1fe5da089ffcba6ef6560d5c3e67149035f55cb6 Mon Sep 17 00:00:00 2001 +From: Rosen Penev +Date: Fri, 17 Oct 2025 14:41:32 -0700 +Subject: [PATCH] fix wrong format for 32-bit and 64-bit time + +Just cast the whole thing. +--- + src/digitemp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/digitemp.c ++++ b/src/digitemp.c +@@ -2744,7 +2744,7 @@ int main( int argc, char *argv[] ) + if( (time(NULL) > last_time + sample_delay) && (sample_delay > 0) ) + { + fprintf(stderr, "Warning: delay (-d) is less than the time needed to "); +- fprintf(stderr, "read all of the attached sensors. It took %ld seconds", (long int) time(NULL) - last_time ); ++ fprintf(stderr, "read all of the attached sensors. It took %ld seconds", (long int) (time(NULL) - last_time) ); + fprintf(stderr, " to read the sensors\n" ); + } + -- 2.30.2